<?php
	require_once "../Controle/Config.php";
	require_once "../Controle/Util.php";
	require_once "../Controle/ControleSessao.php";
	require_once "../Controle/ControleGaleriaSimples.php";
	
	$LstFoto = new ControleGaleriaSimples;
	$LstFoto->listar("WHERE idfoto=".$_GET['idfoto']."",false);
	
	$idfoto=$LstFoto->cmp[0]['idfoto'];
	$foto=$LstFoto->cmp[0]['foto'];
	$status=$LstFoto->cmp[0]['status'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
	<meta name="author" content="Paulo Rios">
	<!--link href="../css/global.css" rel="stylesheet" type="text/css" /-->
	<title>Untitled 7</title>
</head>

<body>
<div style="padding:10px;width:580px;">
	<div class="tituloPop">Editar Foto/Imagem</div>
	<div class="alerta" id="DivAlerta"></div>
	<!-- conteudo -->
	<form name="FormGaleriaSimplesEdt" id="FormGaleriaSimplesEdt" action="../Controle/ControleGaleriaSimples.php?Exec=EdtFoto&limite=<?=$_GET['limite'];?>&pag=<?=$_GET['pag'];?>&<?=mt_rand(1,2500);?>" method="post" enctype="multipart/form-data" >
	<input type="hidden" name="idfoto" value="<?=$idfoto;?>">
	<table width="100%" border="0">
		<tr>
			<!-- td da imagem -->
			<td valign="top">
				<table width="100%">
					<tr>
						<td></td>
						<td>
							<table width="100%" style="border:solid 1px #cccccc;" bgcolor="#f7f7f7" cellpadding="0">
								<tr>
									<td width="90"><img src="../pics/galeria/mini_<?=$foto;?>" alt="" style="border:solid 1px #ffffff;"/></td>
									<td>
										<div style="height:75px;"></div>
										<div style="font-size:10px;margin:1px;border:solid 0px #efefef; width:100%; background-color:#fff;">
											<? $KBS = ceil(filesize("../pics/galeria/".$foto)/1024); ?>
											<? list($width, $height) = getimagesize("../pics/galeria/".$foto);?>
											&nbsp;<span style="color:<?=$KBS>150?"#ff0000":"#000000";?>"><?=$KBS;?>KB</span> | <a href="../pics/galeria/<?=$foto;?>" target="blank"><img src="../images/lupa.png" alt="" align="absmiddle" border="0" /></a> <?= $width;?> &times; <?=$height;?>
										</div>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr bgcolor="#f7f7f7">
						<td valign="top">Foto/Imagem</td>
						<td>
						<input type="radio" name="manip" value="manter" checked /> Manter 
						<input type="radio" name="manip" value="substituir" /> Substituir<br>
						<input type="file" class="file" name="foto"></td>
					</tr>
					<tr>
						<td>Status</td>
						<td>
							<select name="status">
								<option value=0 <?=$status==0?"selected":"";?>>Bloqueada</option>
								<option value=1 <?=$status==1?"selected":"";?>>Desbloqueada</option>
							</select>
						</td>
					</tr>
					<tr>
						<td></td>
						<td><input type="submit" class="btsubmit" value="CONFIRMA" /></td>
					</tr>
				</table>
			</td>
			<!-- fim do td da imagem -->
			<!-- td dimensoes da imagem -->
			<td width="180" style="padding:5px;" valign="top">
				<div style="border:solid 1px #cccccc;padding:5px;">
					Redimensionamento da Imagem
				</div>
				<div style="border:solid 1px #cccccc;padding:5px;background-color:#f7f7f7;">
					<select onchange="javascript:VerTipoRedimensionamento(this.value)" name="manip_tipo_dimensao">
						<option value="proporcao">Propor&ccedil;&atilde;o</option>
						<option value="recorte">Recorte</option>
					</select>
					<hr size="1">
					<div id="proporcao">
					<input type="radio" name="dimen" value="500x375" /> 500 &times; 375 (Recomendado)<br>
					<input type="radio" name="dimen" value="800x600" /> 800 &times; 600<br>
					<input type="radio" name="dimen" value="1024x768" /> 1024 &times; 768<br>
					<input type="radio" name="dimen" value="original" checked > Manter dimens&atilde;o original<br>
					</div>
					<div id="recorte" style="display:none;">
					<table>
						<tr>
							<td>Largura</td>
							<td>altura</td>
						</tr>
						<tr>
							<td><input type="text" style="width:60px;" name="x" /></td>
							<td><input type="text" style="width:60px;" name="y" /></td>
						</tr>
					</table>
					</div>
				</div>
			</td>
			<!-- fim da td dimensoes da imagem -->
		</tr>
	</table>
	</form>
	<!-- fim do conteudo -->

</div>
<script>
	setTimeout("foco('nome')",500);
</script>
</body>
</html>